package com.ttxz.common.holder

import androidx.recyclerview.widget.RecyclerView
import androidx.viewbinding.ViewBinding

/**
 * Recyclerview中使用viewbinding的通用Viewholder，可以更方便的使用`ItemBinding`。
 *
 * <br/>
 * **示例如下：**
 * ```kotlin
 *
 *      class DemoRecyclerViewAdapter(private var mDatas: List<DataBean>) : RecyclerView.Adapter<CommonRecyclerViewHolder<ItemDemoBinding>>() {
 *
 *           override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CommonRecyclerViewHolder<ItemDemoBinding> {
 *               //将自己的item布局所生成的binding，创建出ViewHolder
 *               return CommonRecyclerViewHolder(ItemDemoBinding.inflate(LayoutInflater.from(parent.context), parent, false))
 *           }
 *
 *           override fun onBindViewHolder(holder: CommonRecyclerViewHolder<ItemDemoBinding>, position: Int) {
 *               //此处处理数据显示
 *               val itemData = mDatas[position]
 *               holder.binding.tvName.text = itemData.name
 *
 *           }
 *
 *      }
 * ```
 */
class CommonRecyclerViewHolder<T:ViewBinding>(var binding: T) :
    RecyclerView.ViewHolder(binding.root) {


}